package com.his.dao.jpa;

import java.math.BigDecimal;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.his.pojos.jpa.HisDoctor;

public interface MxjDoctorDAO extends CrudRepository<HisDoctor, Long> {
	@Query("select max(ssryNo) from HisDoctor")
	public String findDoctormaxId();
	
	@Query("select ygNo from HisDoctor")
	public BigDecimal findygNOByygName(String ygName);
	
	@Query("from HisDoctor d,HisEmployee e"
			+ " where d.ygNo=e.ygNo and e.ygPost=:ygPost and d.ssNo=:ssNo")
	public HisDoctor findAdoctor(@Param("ygPost")String ygPost,@Param("ssNo")BigDecimal ssNo);
	
	@Query("select ssryNo from HisDoctor where ssryNo=:ssryNo")
	public String inspect(@Param("ssryNo")long ssryNo);
	
}
